package oo_day03;

public class Test {
    public static void main(String[] args) {

        Dog[]dogs = new Dog[3];
        dogs[0] = new Dog("小白",1,"白");
        dogs[1] = new Dog("小黑",2,"黑");
        dogs[2] = new Dog("小黄",3,"黄色");
        for (int i = 0; i < dogs.length; i++) {
            System.out.println(dogs[i].name);
            System.out.println(dogs[i].age);
            System.out.println(dogs[i].color);
            dogs[i].drink();
            dogs[i].eat();
        }
        Chick[]chicks = new Chick[3];
        chicks[0] = new Chick("小鸡",1,"白色");
        chicks[1] = new Chick("小小鸡",2,"黑色");
        chicks[2] = new Chick("小小小鸡",3,"灰色");
        for (int i = 0; i < chicks.length; i++) {
            System.out.println(chicks[i].name);
            chicks[i].eat();
            chicks[i].drink();
        }
        Fish[]fish = new Fish[2];
        fish[0] = new Fish("小鱼",1,"白色");
        fish[1] = new Fish("小小鱼",2,"黑色");
        for (int i = 0; i < fish.length; i++) {
            System.out.println(fish[i].name);
            fish[i].swim();
        }

    }
}

